<!DOCTYPE HTML>
<html lang="zh-CN" data-rem="375">
<head>
    <meta charset="UTF-8">
    <title>项目部</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="apple-mobile-web-app-capable" content="no"/>
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css" href="/css/style-project.css"/>


</head>
<body>
<div class="page-top">
    @if(!$keyword)
        <div class="page-nav">
            <span class="page-nav-title">项目部</span>
            <a href="{{route('search')}}">
                <img src="/img/common/search-icon-black.png" alt="" class="nav-search">
            </a>
        </div>
    @else
        <div class="search-nav">
            <div class="back-arrow" onclick="window.history.go(-1)"><img src="/img/common/arrow-left.png" alt="" class="back-img"></div>
            <input type="text" class="search-ipt" name="name" value="{{$keyword}}">
            <div class="search-img-wrapper"><img src="/img/common/search-icon-black.png" alt="" class="search-icon"></div>
        </div>
    @endif
    <div class="page-select-tab">
        <div class="select-item">@if($parent_category) {{$parent_category->title}} @else 一级分类 @endif <img src="/img/common/arrow-down.png" width="11px" height="6px" alt=""
                                           class="arrow-down"></div>
        <div class="select-item">@if($category) {{$category->title}} @else 二级分类 @endif <img src="/img/common/arrow-down.png" width="11px" height="6px" alt=""
                                           class="arrow-down"></div>
        <div class="select-item"> @if($amount_item) {{$amount_item->value}} @else 投资金额 @endif <img src="/img/common/arrow-down.png" width="11px" height="6px" alt=""
                                           class="arrow-down"></div>
    </div>
</div>
<div class="page-content">
    <div id="ajaxTabContent">
        <div class="goods-list">
            @foreach($projectList['list'] as $item)
                <a href="{{route('project.info', ['id' => $item->id])}}">
                    <div class="goods-item">
                        <div class="goods-item-top">
                            <img class="goods-img"
                                 src="{{$item->adv_map[0]}}" alt="">
                        </div>
                        <div class="goods-item-bto">
                            <div class="goods-name">{{$item->name}}</div>
                            <div class="goods-price">投资金额：{{$item->amount_show}}</div>
                            <div class="goods-tag">咨询</div>
                        </div>
                    </div>
                </a>
            @endforeach
        </div>
    </div>
    <div class="loadmore hasMore"><a href="javascript:void(0);">查看更多</a></div>
</div>


<div class="page-footer">
    <div class="footer-item">
        <a href="/">
            <img src="/img/tabbar/tabbar-home.png" width="27px" height="24px" alt="" class="footer-img">
            <span class="footer-txt ">首页</span>
        </a>
    </div>
    <div class="footer-item">
        <a href="/project">
            <img src="/img/tabbar/tabbar-home-active.png" width="27px" height="24px" alt="" class="footer-img">
            <span class="footer-txt footer-txt-active">项目部</span>
        </a>
    </div>
    <div class="footer-item">
        <a href="/news">
            <img src="/img/tabbar/tabbar-home.png" width="27px" height="24px" alt="" class="footer-img">
            <span class="footer-txt">创业资讯</span>
        </a>
    </div>
    <div class="footer-item">
        <a href="/rank">
            <img src="/img/tabbar/tabbar-home.png" width="27px" height="24px" alt="" class="footer-img">
            <span class="footer-txt">排行榜</span>
        </a>
    </div>
</div>


    <div id="firstLayout" class="layui-m-layer layui-m-layer0 layout" >
        <div class="layui-m-layershade"></div>
        <div class="layui-m-layermain">
            <div class="layui-m-layersection">
                <div class="layui-m-layerchild Inside layui-m-anim-up">
                    <div class="layui-m-layercont">
                        <aside class="SysList" id="FirstLevel">
                            <a class="moderm" onclick="jump('{{$keyword}}', '0', '0', '{{$amount_item->id ?? 0}}')" href="javascript:void(0);" target="_self">全部</a>
                            @foreach($catList as $item)
                                <a onclick="jump('{{$keyword}}', '{{$item->id}}', '0', '{{$amount_item->id ?? 0}}')" href="javascript:void(0);" target="_self" title="{{$item->title}}" >
                                    {{$item->title}}
                                </a>
                            @endforeach
                        </aside>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="secondLayout" class="layui-m-layer layui-m-layer0 layout" >
        <div class="layui-m-layershade"></div>
        <div class="layui-m-layermain">
            <div class="layui-m-layersection">
                <div class="layui-m-layerchild Inside layui-m-anim-up">
                    <div class="layui-m-layercont">
                        <aside class="SysList" id="FirstLevel">
                            <a class="moderm" onclick="jump('{{$keyword}}', '{{$parent_category->id ?? 0}}', '0', '{{$amount_item->id ?? 0}}')" href="javascript:void(0);" target="_self">全部</a>
                            @if($child_category)
                                @foreach($child_category as $item)
                                    <a onclick="jump('{{$keyword}}', '{{$item->parent_id}}', '{{$item->id}}', '{{$amount_item->id ?? 0}}')" href="javascript:void(0);" target="_self" title="{{$item->title}}">{{$item->title}}</a>
                                @endforeach
                            @endif
                        </aside>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div id="threeLayout" class="layui-m-layer layui-m-layer0 layout" >
        <div class="layui-m-layershade"></div>
        <div class="layui-m-layermain">
            <div class="layui-m-layersection">
                <div class="layui-m-layerchild Inside layui-m-anim-up">
                    <div class="layui-m-layercont">
                        <aside class="SysList" id="FirstLevel">
                            <a class="moderm" onclick="jump('{{$keyword}}', '{{ $parent_category->id ?? 0}}', '{{$category->id ?? 0}}', '0')" href="javascript:void(0);" target="_self">全部</a>
                            @foreach($amountList as $item)
                                <a onclick="jump('{{$keyword}}', '{{ $parent_category->id ?? 0}}', '{{$category->id ?? 0}}', '{{$item->id}}')" href="javascript:void(0);" target="_self" title="{{$item->value}}">{{$item->value}}</a>
                            @endforeach
                        </aside>
                    </div>
                </div>
            </div>
        </div>
    </div>




<script crossorigin="anonymous" integrity="sha384-qu2J8HSjv8EaYlbzBdbVeJncuCmfBqnZ4h3UIBZ9WTZ/5Wrqt0/9hofL0046NCkc"
        src="https://lib.baomitu.com/zepto/1.2.0/zepto.min.js"></script>
<script src="/js/utils.js"></script>

<script>

    function jump(keyword,parent_cat_id, cat_id,amount) {
        var url;
        if (keyword) {
            url = '/project/keyword/'+keyword;
        } else {
            url = '/project';
            if (parent_cat_id >0 ) {
                url += '/type' + parent_cat_id;
                if (cat_id > 0) {
                    url += '-' + cat_id;
                }
            }
            if (amount > 0) {
                url += '/amount' + amount;
            }
        }
        location.href = url;
    }

    $(function () {
        var currentPage = 1;

        $(".hasMore").click(function () {
            $.get("{{route('h5.ajax.project.list', ['keyword' => $keyword, 'parent_category_id' => $parent_category->id ?? 0, 'category_id' => $category->id ?? 0, 'amount' => $amount_item->id ?? 0])}}"
                , {page: (currentPage+1) }, function (result) {
                currentPage = parseInt($(result).find(".currentPage").val());
                has_more_page = $(result).find(".has_more_page").val();
                $("#ajaxTabContent").append(result);
                if (!has_more_page)
                    $(".hasMore").hide();
            });
        });


        $(document).on('click',".select-item",function () {
            var index = $(this).index();
            if(index === 0) {
                $("#firstLayout").show();
            }
            if(index === 1) {
                $("#secondLayout").show();
            }
            if(index === 2) {
                $("#threeLayout").show();
            }
        });
        $(document).on("click",".layui-m-layershade",function () {
            $(".layout").hide();
        });

    })
</script>
</body>
</html>